﻿//* Copyright(C) 2005-2012, all rights reserved.
//*
//* The following code is copyrighted and contains proprietary information
/* and trade secrets of Foxit Software Inc.      
**************************************************************************
*/

/**
工具接口类
*/



define(function (require, exports, module) {
    require('./Event.js');
    var Interface = require('../Interface');

    FXREADER.TOOL_NAME_HAND = "Hand"; //手型工具名称

    //接口列表
    var ToolHandlerInterface = new Interface('IReader_ToolHandler', ['Tool_OnInit', 'Tool_Destroy', 'Tool_GetName', 'Tool_OnActivate', 'Tool_OnDeactivate'
        , 'Tool_OnKeyDown', 'Tool_OnKeyUp', 'Tool_OnChar', 'Tool_IsEnabled', 'Tool_IsProcessing', 'Tool_OnLButtonDown', 'Tool_OnLButtonUp', 'Tool_OnLButtonDblClk', 'Tool_OnMouseMove'
        , 'Tool_OnRButtonDown', 'Tool_OnRButtonUp', 'Tool_OnRButtonDblClk', 'Tool_OnMouseWheel', 'Tool_OnMouseOver', 'Tool_OnMouseOut', 'Tool_OnMouseEnter'
        , 'Tool_OnMouseLeave']);

    /**
     * @description Interface of the tool handler.
     * @class Interface of the tool handler.
     */
    FXREADER.Event.IReader_ToolHandler = function () {

    };

    FXREADER.Event.IReader_ToolHandler.prototype = {
    	/**
    	  * @description  trigger when the tool initialize.
    	  * @param {FXREADER.CReaderApp} pReaderApp App Object
    	*/
        Tool_OnInit : function (pReaderApp) {
        },
        /**
         * @description trigger when the tool destroys.
         */
        Tool_Destroy : function () {
        },
        /**
         * @description return the name of the tool.
         * @return {String} the name of the tool.
         */
        Tool_GetName : function () {
        },
        // UI Events
        /**
         * @description trigger when the tool is activated.
         */
        Tool_OnActivate : function () {
        },
        /**
         * @description trigger when other tool is activated.
         */
        Tool_OnDeactivate : function () {
        },
        Tool_OnKeyDown : function (event) {
            return false;
        },
        Tool_OnKeyUp : function (event) {
            return false;
        },
        Tool_OnChar : function (event) {
            return false;
        },

        // Calculate status
		/**
        * @description return true if the tool is enabled.
        * @return {Boolean} return true if the tool is enabled.
        */
        Tool_IsEnabled : function () {
            return false;
        },
        /**
         * @description return true if current mouse event is processing by the tool, and all of events of “IReader_MousePtHandler” will not be triggered. 
         * @return {Boolean} return true if current mouse event is processing by the tool, and all of events of “IReader_MousePtHandler” will not be triggered. 
         */
        Tool_IsProcessing : function () {
            return false;
        },

        // Mouse events
		/**
        * @description left mouse button down.
        * @param {object} event information of the event.
        * @return {Boolean} return true if you don't want other event handler to process this event, otherwise ,return false.
        */
        Tool_OnLButtonDown : function (event) { },
		/**
        * @description left mouse button up.
        * @param {object} event information of the event.
        * @return {Boolean} return true if you don't want other event handler to process this event, otherwise ,return false.
        */
        Tool_OnLButtonUp  :  function (event) { },
		/**
        * @description left mouse button double click.
        * @param {object} event information of the event.
        * @return {Boolean} return true if you don't want other event handler to process this event, otherwise ,return false.
        */
        Tool_OnLButtonDblClk  :  function (event) { },
		/**
        * @description mouse move.
        * @param {object} event information of the event.
        * @return {Boolean} return true if you don't want other event handler to process this event, otherwise ,return false.
        */
        Tool_OnMouseMove  :  function (event) { },
		/**
        * @description right mouse button down.
        * @param {object} event information of the event.
        * @return {Boolean} return true if you don't want other event handler to process this event, otherwise ,return false.
        */
        Tool_OnRButtonDown  :  function (event) { },
		/**
        * @description right mouse button up.
        * @param {object} event information of the event.
        * @return {Boolean} return true if you don't want other event handler to process this event, otherwise ,return false.
        */
        Tool_OnRButtonUp  :  function (event) { },
		/**
        * @description right mouse button double click.
        * @param {object} event information of the event.
        * @return {Boolean} return true if you don't want other event handler to process this event, otherwise ,return false.
        */
        Tool_OnRButtonDblClk  :  function (event) { },
        Tool_OnMouseWheel  :  function (event) { },
        Tool_OnMouseOver  :  function (event) { },
        Tool_OnMouseOut  :  function (event) { },
        Tool_OnMouseEnter  :  function (event) { },
		/**
        * @description trigger when the mouse leaves Web Reader.
        * @param {object} event information of the event.
        * @return {Boolean} return true if you don't want other event handler to process this event, otherwise ,return false.
        */
        Tool_OnMouseLeave  :  function (event) { }
    };

    FXREADER.Event.IReader_ToolHandler.EnsureInterface = function (subclass) { //确保派生类实现相应接口
        Interface.ensureImplements(subclass, ToolHandlerInterface);
    };

    return FXREADER.Event.IReader_ToolHandler;
});